package internal

import (
	"go.uber.org/zap"
	"gogogo-server/engine/cororpc"
	"gogogo-server/engine/module"
	"gogogo-server/logicserver/game"
	"gogogo-server/protocol"
)

type LetGoGate struct {
	*module.LGGate
}

func (lg *LetGoGate) OnInit() error {
	lg.LGGate = module.GateInstance()
	return nil
}

func (lg *LetGoGate) AfterInit() error {
	c := lg.GetServer("clientlink")
	if c == nil {
		zap.S().Fatal("获取 clientlink 失败")
	}
	c.MsgProcessor.RegisterRouter(protocol.MsgEventHelloWorld, &protocol.HelloWorld{}, game.Module.GetServerCoroRPC())
	return nil
}

func (lg *LetGoGate) GetServerCoroRPC() *cororpc.RPCServer {
	return nil
}

func (lg *LetGoGate) OnDestroy() {

}
